]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
volume: Suppress a critical warning
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 1 Feb 2013 19:19:02 +0000 (20:19 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Feb 2013 11:42:36 +0000 (12:42 +0100)
gvc_mixer_stream_get_port() emits a warning in the no-ports case,
which we can avoid by rearranging the check for that case.

https://bugzilla.gnome.org/show_bug.cgi?id=693049

js/ui/status/volume.js

index b25060cfa7bbc5b84e9e6b6b0a12774a6b92a402..8075496d3330da9a90d6030e11f7e0170a364420 100644 (file)
@@ -169,9 +169,8 @@ const OutputStreamSlider = new Lang.Class({
         // a bit hackish, but ALSA/PulseAudio have a number
         // of different identifiers for headphones, and I could
         // not find the complete list
-        let port = sink.get_port();
-        if (port)
-            return port.port.indexOf('headphone') >= 0;
+        if (sink.get_ports().length > 0)
+            return sink.get_port().port.indexOf('headphone') >= 0;
 
         return false;
     },